<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" 
	xmlns:lzc="http://schemas.icitadel.com/Lazarus/Compiled.xsd"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:output method="html"/>

   <xsl:template name="Directive">
      <xsl:param name="pValue" />
      <xsl:text disable-output-escaping="yes">&lt;%@ </xsl:text>
      <xsl:value-of select="$pValue" />
      <xsl:text disable-output-escaping="yes"> %&gt;
</xsl:text>
   </xsl:template>
   
   <xsl:template name="Declaration">
      <xsl:param name="pValue" />
      <xsl:text disable-output-escaping="yes">&lt;!</xsl:text>
      <xsl:value-of select="$pValue" />
      <xsl:text disable-output-escaping="yes">&gt;
</xsl:text>
   </xsl:template>
   
   <xsl:template name="WebControl">
      <xsl:param name="pTagName" />
      <xsl:param name="pAttributes" />
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
      <xsl:value-of select="$pTagName" />
      <xsl:value-of select="$space" />
      <xsl:value-of select="$pAttributes" />
      <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;/</xsl:text>
      <xsl:value-of select="$pTagName" />
      <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
   </xsl:template>
   
   <xsl:template name="getDataGridColumnType">
		<xsl:param name="pField" />
      <xsl:choose>
			<xsl:when test="$pField/lzc:indexes/lzc:index[ @type = $INDEXTYPE_FOREIGN ]">
				<xsl:text>DropDownPicklistColumn</xsl:text>
			</xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_GUID">
            <xsl:text>GuidColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_BOOLEAN">
            <xsl:text>CheckBoxColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_TEXT">
            <xsl:text>TextColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_VARCHAR">
            <xsl:text>TextColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_DATETIME">
            <xsl:text>DateColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_INT">
            <xsl:text>IntegerColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_IDENTITY">
            <xsl:text>IntegerColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_MONEY">
            <xsl:text>FloatColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_FLOAT">
            <xsl:text>FloatColumn</xsl:text>
         </xsl:when>
         <xsl:when test="$pField/@type = $DATATYPE_DECIMAL">
            <xsl:text>FloatColumn</xsl:text>
         </xsl:when>
         <xsl:otherwise>
				<xsl:value-of select="$pField/@type" />
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <xsl:template name="getImportDataGridColumnType">
		<!-- Unless the field is a primary key, a string column type is returned. -->
		<xsl:param name="pField" />
      <xsl:choose>
			<xsl:when test="$pField/lzc:indexes/lzc:index[ @type = $INDEXTYPE_PRIMARY ]">
				<xsl:call-template name="getDataGridColumnType">
					<xsl:with-param name="pField" select="$pField" />
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>TextColumn</xsl:text>
			</xsl:otherwise>
    </xsl:choose>
   </xsl:template>

</xsl:stylesheet>

  